< previous page page_241 next page >

Page 241
Removing Pieces
To remove a module or form from your project, simply select the form or module in the Project window and choose Project, Remove. Visual Basic asks you to confirm that you want to remove the file and then removes it from your project.
Controlling How Your Program Starts
When you first start a programming project, Visual Basic assumes that the first form created is the one that will be displayed as soon as the program starts. Although this will be the case for many programs, for others you may want to start with one of the forms you create later in the development process. For some programs, you might not want to start with a form at all.
Setting the Startup Form
If the first form is not the one you want to use to start your program, Visual Basic lets you choose which of your forms is shown initially by the program. This selection is made in the Project Properties dialog box, as shown in Figure 11.13. You access this dialog box by selecting Project, Project Properties.
0241-01.jpg
Figure 11.13
The Startup Object list lets you choose
which form is loaded when your program starts.
Using Sub Main
You might have noticed that, in addition to listing all the forms contained in your project, the Startup Object list includes the entry Sub Main. This reserved procedure name lets your program start without an initial form. If you choose this option, one of your module files must include a procedure called Main.
One reason to start your program with the Sub Main option might be that you need to perform some initialization routines before loading any forms. Another reason might be that you are developing a command-line utility that requires no user interaction.

 
< previous page page_241 next page >